package adapter;

import android.bluetooth.BluetoothDevice;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import base.BaseApplication;
import xm.chengdu.com.beijing_211.R;


/**
 * Created by  on 2016/12/3.
 *
 */

public class Spinner_Adapter extends Base_Z_Adapter {
    Spinner_Adapter.Holder holder;

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        // 复用convertView
        if (null == convertView) {
            convertView = LayoutInflater.from(BaseApplication.getInstance())
                    .inflate(R.layout.tab_lv2, null);
            holder = new Spinner_Adapter.Holder();

            holder.name = (TextView) convertView
                    .findViewById(R.id.name);


            // 设置Holder
            convertView.setTag(holder);
        } else {
            holder = (Spinner_Adapter.Holder) convertView.getTag();
        }
        String s = (String) getItem(position);
        holder.name.setText(s);
        return convertView;
    }



    public class Holder {

        TextView name;

    }
}
